import request from './request'

const defaultState = {
    authenticated: false,
}

function authReducer(state = {...defaultState}, action) {
    switch (action.type) {
        case 'login':
            return {...state, authenticated: true, user: action.payload}
        case 'logout':
            return {...state, authenticated: false, user: null,}
        default:
            return state
    }
}

const reducers = {
    auth: authReducer,
    // request: request,
}

export default reducers;